<?php
class PaymentCreditCard extends PaymentData{

	public $cardNumber;
	public $cardCode;
	public $cardExpDate;
	
	public function __construct(){
		$this->setName('creditCardInfo');
	}
	
	public function toArray(){
		return array(
			'cardNumber'	=>	$this->cardNumber,
			'cardCode'		=>	$this->cardCode,
			'cardExpDate'	=>	$this->cardExpDate,
		);
	}
	
	public function vaild(){
		foreach ($this->toArray() as $key=>$val){
			if (empty($val)){
				$this->setErrorMessage($key,$key.' NO');
			}
		}
		
		return $this->vaild;
	}
}